<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>集合遍历</title>
</head>
<body>
   <h1>集合遍历</h1>

      <div th:each="item:${list}">
           <div>
              姓名：[[${item.name}]]
              年龄：[[${item.age}]]
           </div>
      </div>
     <hr>
   <div th:each="item,star:${list}">
     <div>
       序号：[[${star}]]-[[${star.count}]]-[[${star.index}]]
       姓名：[[${item.name}]]
       年龄：[[${item.age}]]
     </div>
   </div>


</body>
</html>